package academic.concordia.bankofquebec.dao.investmentaccount;

import java.util.Date;
import java.util.List;

import org.hibernate.SessionFactory;

import academic.concordia.bankofquebec.bean.utils.InvestmentAccountUtils;
import academic.concordia.bankofquebec.entity.BankAccount;
import academic.concordia.bankofquebec.entity.InvestmentAccount;

public class InvestmentAccountDAO implements IInvestmentAccountDAO {
	
	private SessionFactory sessionFactory;

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	public List<InvestmentAccount> getAccountToPayInterest() {
		@SuppressWarnings("unchecked")
		List<InvestmentAccount> list = (List<InvestmentAccount>) getSessionFactory().getCurrentSession()
											.createQuery("from BankAccount where BankAccount_Data='INVESTMENT_ACCOUNT'")
											.list();
		return list;
	}

}
